package com.yijinsuo.base;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ekikousei易皇星 on 16/11/22.
 * E-mail:13764664731@163.com
 * Signature:缘分是本书,翻的不经意会错过,读的太认真会流泪!!
 * <p/>
 * TODO:类描述:    ViewPager滑动fragment公共适配器
 */
public class ViewPagerIndicatorAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragmentList;


    public ViewPagerIndicatorAdapter(FragmentManager fm,List<Fragment> fragmentList) {
        super(fm);

        this.fragmentList=fragmentList;
    }
    @Override
    public int getCount() {
        if(fragmentList==null){
            fragmentList=new ArrayList<Fragment>();
        }
        return fragmentList.size();
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }


}
